package com.example.demo;

import com.jfinal.template.ext.spring.JFinalViewResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;

@Configuration
public class SpringBootConfig {
    @Bean
    public ViewResolver viewResolver() {
        JFinalViewResolver resolver = new JFinalViewResolver();
        resolver.setBaseTemplatePath(null);
        resolver.getEngine().setToClassPathSourceFactory();
        resolver.getEngine().setBaseTemplatePath("/templates");
        resolver.setDevMode(true);
        return resolver;
    }
}
